// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'babel-polyfill';
import Vue from 'vue'
import VueLazyload from 'vue-lazyload';
import App from './App'
import router from './router'
import store from './store';
import './styles/app.less';
import 'mint-ui/lib/style.css';
import './utils/rem';
import {
  install,
} from './plugins/xmintUI';

Vue.use(install);
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: 'http://mycdn.avicare.cn/group1/M00/00/7F/O24cYVjt4GKAJovCAABAeKv7Krs288.jpg',
  // loading: 'http://mycdn.avicare.cn/group1/M00/00/7F/O24cYVjt4MeATtX-AAAvKdc4p9A543.gif',
  loading: 'http://mycdn.avicare.cn/group1/M00/01/19/O24cYVkRFFWAEyinAAARrQpHyUU170.png',
  attempt: 1,
});
Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
  next();
});

router.afterEach(() => {});

// 生产环境错误日志
if (process.env === 'production') {
  Vue.config.errorHandler = function (err, vm) {
    console.log(err, window.location.href);
  };
};

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: {
    App
  },
  template: '<App/>'
})
